Skip to content

Feature/integrate http tooling#82

Merged
cuioss-oliver merged 8 commits into
masterfrom
feature/integrate_http_tooling
Jun 2, 2025
Merged

Feature/integrate http tooling#82
cuioss-oliver merged 8 commits into
masterfrom
feature/integrate_http_tooling

Conversation

@cuioss-oliver

Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @cuioss, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

gemini-code-assist here, providing a summary of this pull request. The primary goal of this PR, as indicated by the title, is to integrate new HTTP tooling into the library. This involves adding utilities for handling HTTP requests, status codes, and secure SSL contexts, leveraging the modern java.net.http.HttpClient. The changes introduce a new package de.cuioss.tools.net.http containing the core components. Additionally, there are minor updates to the build configuration and some internal refactoring of builder patterns in string utility classes.

Highlights

  • New HTTP Utilities: Introduced a new package de.cuioss.tools.net.http containing HttpHandler (a wrapper for java.net.http.HttpClient with builder-based configuration), HttpStatusFamily (an enum for categorizing HTTP status codes), and SecureSSLContextProvider (for managing secure SSL contexts and enforcing modern TLS versions).
  • Secure SSL Context Handling: The SecureSSLContextProvider ensures that HTTPS connections default to using secure TLS versions (TLS 1.2, TLS 1.3) and provides a mechanism to validate or create secure SSLContext instances.
  • HTTP Request Handling: The HttpHandler provides a convenient builder for configuring HTTP requests (URI, timeout, SSL context) and includes utility methods like pingHead and pingGet.
  • String Utility Builder Refactoring: Replaced the Lombok @Builder annotation with custom static builder inner classes for JoinerConfig and SplitterConfig. This change appears to be an internal refactoring of how these configuration objects are built.
  • Module Info and Dependencies: Updated module-info.java to require java.net.http and export the new de.cuioss.tools.net.http package. The pom.xml was updated to a new parent version and changed the scope of jakarta.annotation-api.
  • Comprehensive Unit Tests: Added new unit tests covering the functionality of HttpHandler, HttpStatusFamily, and SecureSSLContextProvider.

Changelog

Click here to see the changelog
  • README.adoc
    • Added documentation section for the new de.cuioss.tools.net utilities, including http and ssl sub-sections, listing the new classes.
  • pom.xml
    • Updated parent artifact version from 1.0.1 to 1.0.2.
    • Changed the scope of the jakarta.annotation-api dependency from test to provided.
  • src/main/java/de/cuioss/tools/net/http/HttpHandler.java
    • Added new class HttpHandler for wrapping java.net.http.HttpClient, providing a builder for configuration (URI, timeout, SSL context) and methods for executing requests like pingHead and pingGet.
  • src/main/java/de/cuioss/tools/net/http/HttpStatusFamily.java
    • Added new enum HttpStatusFamily to represent HTTP status code families (1xx, 2xx, 3xx, 4xx, 5xx, UNKNOWN) with utility methods for checking status codes.
  • src/main/java/de/cuioss/tools/net/http/SecureSSLContextProvider.java
    • Added new class SecureSSLContextProvider to provide and manage secure SSLContext instances, enforcing minimum TLS versions (TLS 1.2, 1.3) and rejecting insecure ones.
  • src/main/java/de/cuioss/tools/net/http/package-info.java
    • Added package documentation for de.cuioss.tools.net.http.
  • src/main/java/de/cuioss/tools/net/package-info.java
    • Updated package documentation for de.cuioss.tools.net to include the new HTTP utilities.
  • src/main/java/de/cuioss/tools/string/JoinerConfig.java
    • Replaced Lombok's @Builder annotation with a manually defined static Builder inner class and static builder() method.
    • Updated the copy() method to use the new custom builder.
  • src/main/java/de/cuioss/tools/string/SplitterConfig.java
    • Replaced Lombok's @Builder annotation with a manually defined static Builder inner class and static builder() method.
    • Updated the copy() method to use the new custom builder.
  • src/main/java/module-info.java
    • Added requires java.net.http;.
    • Exported the new package de.cuioss.tools.net.http.
  • src/test/java/de/cuioss/tools/net/http/HttpHandlerTest.java
    • Added new unit tests for the HttpHandler class.
  • src/test/java/de/cuioss/tools/net/http/HttpStatusFamilyTest.java
    • Added new unit tests for the HttpStatusFamily enum.
  • src/test/java/de/cuioss/tools/net/http/SecureSSLContextProviderTest.java
    • Added new unit tests for the SecureSSLContextProvider class.
  • src/test/java/de/cuioss/tools/net/ssl/KeyMaterialHolderTest.java
    • Updated the assertion message in a test case for NullPointerException.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Status codes fly,
Two hundred means all is well,
Four hundred, client error.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive suite of HTTP tooling, including HttpHandler for making requests, HttpStatusFamily for interpreting status codes, and SecureSSLContextProvider for managing SSL/TLS settings. The new additions are well-documented and come with extensive unit tests, which is commendable.

The refactoring of JoinerConfig and SplitterConfig to utilize manual builders instead of Lombok's @Builder has also been noted. This change seems to be implemented correctly and maintains the existing functionality, with SplitterConfig.copy() now correctly including the pattern.

Overall, the changes are a significant enhancement to the library. I have a couple of minor points for consideration.

Summary of Findings

  • SSLContext for non-HTTPS URIs in HttpHandler: HttpHandler's createHttpClient method configures the HttpClient with an SSLContext even for plain HTTP URIs if one is available. This is unusual and could be clarified or reconsidered.
  • Copyright Year: The copyright year in SecureSSLContextProvider.java is set to 2025, which seems to be a future date. It should likely be the current year.
  • Improved Exception Message: The exception message in KeyMaterialHolderTest could be improved by including the parameter name.

Merge Readiness

The pull request is in good shape and adds valuable functionality. There are a couple of medium-severity points raised in the review comments that would be good to address or clarify. Once these are considered, the PR should be ready for merging. As an AI reviewer, I am not authorized to approve pull requests; please ensure further review and approval by authorized maintainers.

Comment thread src/main/java/de/cuioss/tools/net/http/HttpHandler.java Outdated
Comment thread src/test/java/de/cuioss/tools/net/ssl/KeyMaterialHolderTest.java Outdated
@sonarqubecloud

sonarqubecloud Bot commented Jun 2, 2025

Copy link
Copy Markdown

@cuioss-oliver cuioss-oliver merged commit 65784a9 into master Jun 2, 2025
15 checks passed
@cuioss-oliver cuioss-oliver deleted the feature/integrate_http_tooling branch June 2, 2025 19:53
cuioss-oliver added a commit that referenced this pull request Jul 7, 2026
## Summary

Instruments CodeQL scanning and surfaces its status, mirroring cui-http
PR #82 (F-16).

- **`.github/workflows/codeql.yml`** — delegates to the
`cuioss-organization` reusable CodeQL workflow (`reusable-codeql.yml @
v0.7.0`, the same pinned ref this repo already uses for
`maven.yml`/`release.yml`). Triggers on push/PR to `main` and a weekly
schedule. `languages: java`, `build-mode: none` (source analysis — no
Maven build needed for this zero-dependency library). The reusable
workflow fixes the query suite to `+security-and-quality` org-wide.
- **README badge** — adds a CodeQL status badge to the Status section,
in the existing badge style, next to the Maven CI badge.

## Verification
- Confirmed
`cuioss/cuioss-organization/.github/workflows/reusable-codeql.yml`
exists at the pinned `v0.7.0` SHA.
- YAML/AsciiDoc-only change; no sources touched.

Co-authored-by: Oliver Wolff <23139298+cuioss@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant